#!/bin/sh
###############################################################################
##  Author    : XUEZYC
##  Name      : edw_generate_key.sh
##  Functions : Generate encrypt file
##  Purpose   : Generate encrypt file
##  Revisions or Comments
##  VER        DATE        AUTHOR           DESCRIPTION
##---------  ----------  ---------------  ------------------------------------ 
##  1.0      2016-08-08  XUEZYC           1. CREATED THIS SHELL.
###############################################################################

. ${0%`basename ${0}`}edw_parm.sh

read -s -p "Please choose db 1.mysql 2.hive:" db
echo ""
case ${db} in
    1)
        db=mysql
    ;;
    2)
        db=hive
    ;;
esac
echo "db:${db}"
echo ""

read -s -p "Please input the user:" user
echo ""
echo "user:${user}"
echo ${user} | base64 > ${V_SHELL_SECU}/"${db}_query_user"
echo ""

read -s -p "Please input the password:" pswd
echo ""
echo "pswd:${pswd}"
echo ${pswd} | base64 > ${V_SHELL_SECU}/"${db}_query_pswd"
echo ""
echo "Generate encrypt file was completed in security folder!"
echo ""
